IS_CHOKED_LIQ
Overview
The IS_CHOKED_LIQ function checks if the pressure drop across a control valve is high enough to cause liquid choking (cavitation/flashing). It implements the logic defined in the IEC 60534 standard for industrial process control valves.
Flow is considered choked if the actual pressure drop (dP) exceeds the allowable pressure drop calculated from the valve’s recovery factor (FL or FLP/FP) and the fluid properties.
This implementation uses the fluids library.
This example function is provided as-is without any representation of accuracy.
Excel Usage
=IS_CHOKED_LIQ(dP, P_up, Psat, FF, FL, FLP, FP)
dP(float, required): Pressure drop across the valve [Pa]P_up(float, required): Upstream absolute pressure [Pa]Psat(float, required): Liquid vapor pressure at inlet temperature [Pa]FF(float, required): Liquid critical pressure ratio factor [-]FL(float, optional, default: null): Liquid pressure recovery factor of a valve without attached fittings [-]FLP(float, optional, default: null): Combined liquid pressure recovery factor with attached fittings [-]FP(float, optional, default: null): Piping geometry factor [-]
Returns (bool): True if flow is choked (critical), False otherwise.
Examples
Example 1: Choked flow scenario
Inputs:
| dP | P_up | Psat | FF | FL |
|---|---|---|---|---|
| 1000000 | 2000000 | 100000 | 0.9 | 0.5 |
Excel formula:
=IS_CHOKED_LIQ(1000000, 2000000, 100000, 0.9, 0.5)
Expected output:
true
Example 2: Non-choked flow scenario
Inputs:
| dP | P_up | Psat | FF | FL |
|---|---|---|---|---|
| 10000 | 2000000 | 100000 | 0.9 | 0.9 |
Excel formula:
=IS_CHOKED_LIQ(10000, 2000000, 100000, 0.9, 0.9)
Expected output:
false
Example 3: Choked with fittings (FLP/FP)
Inputs:
| dP | P_up | Psat | FF | FLP | FP |
|---|---|---|---|---|---|
| 800000 | 1000000 | 50000 | 0.8 | 0.4 | 0.9 |
Excel formula:
=IS_CHOKED_LIQ(800000, 1000000, 50000, 0.8, 0.4, 0.9)
Expected output:
true
Example 4: Non-choked with fittings
Inputs:
| dP | P_up | Psat | FF | FLP | FP |
|---|---|---|---|---|---|
| 50000 | 1000000 | 50000 | 0.8 | 0.8 | 0.9 |
Excel formula:
=IS_CHOKED_LIQ(50000, 1000000, 50000, 0.8, 0.8, 0.9)
Expected output:
false
Python Code
import micropip
await micropip.install(["fluids"])
from fluids.control_valve import is_choked_turbulent_l as fluids_is_choked
def is_choked_liq(dP, P_up, Psat, FF, FL=None, FLP=None, FP=None):
"""
Determines if a liquid flow in a control valve is choked (critical) or not according to IEC 60534.
See: https://fluids.readthedocs.io/fluids.control_valve.html#fluids.control_valve.is_choked_turbulent_l
This example function is provided as-is without any representation of accuracy.
Args:
dP (float): Pressure drop across the valve [Pa]
P_up (float): Upstream absolute pressure [Pa]
Psat (float): Liquid vapor pressure at inlet temperature [Pa]
FF (float): Liquid critical pressure ratio factor [-]
FL (float, optional): Liquid pressure recovery factor of a valve without attached fittings [-] Default is None.
FLP (float, optional): Combined liquid pressure recovery factor with attached fittings [-] Default is None.
FP (float, optional): Piping geometry factor [-] Default is None.
Returns:
bool: True if flow is choked (critical), False otherwise.
"""
# Validate inputs
try:
dP = float(dP)
P_up = float(P_up)
Psat = float(Psat)
FF = float(FF)
# Validate optional inputs
if FL is not None:
FL = float(FL)
if FLP is not None:
FLP = float(FLP)
if FP is not None:
FP = float(FP)
except (ValueError, TypeError):
return "Error: All inputs must be numbers."
if dP < 0:
return "Error: Pressure drop must be non-negative."
if P_up <= 0:
return "Error: Upstream pressure must be positive."
try:
# Call library function (map P_up to P1)
return fluids_is_choked(dP=dP, P1=P_up, Psat=Psat, FF=FF, FL=FL, FLP=FLP, FP=FP)
except Exception as e:
return f"Error: {str(e)}"